package com.djx.redis.service.impl;

import com.djx.redis.service.RedisClientService;
import com.djx.redis.utils.JedisUtils;
import org.springframework.stereotype.Service;


/**
 * @author dingjunxiong
 */
@Service
public class RedisClientServiceImpl implements RedisClientService {

    @Override
    public String set(String key, String value, int seconds) {
        String set = JedisUtils.set(key, value, seconds);
        return set;
    }

    @Override
    public String get(String key) {
        String str = JedisUtils.get(key);
        return str;
    }

    @Override
    public Object getObject(String key) {
        return JedisUtils.getObject(key);
    }

    @Override
    public String setObject(String key, Object object, int seconds) {
        String set = JedisUtils.setObject(key, object, seconds);
        return set;
    }

    @Override
    public Boolean exists(String key) {
        Boolean exists = JedisUtils.exists(key);
        return exists;
    }

    @Override
    public Boolean expire(String key, int seconds) {
        return JedisUtils.expire(key, seconds);
    }

    @Override
    public Boolean del(String key) {
        return JedisUtils.del(key);
    }

    @Override
    public Long ttl(String key) {
        Long ttl = JedisUtils.ttl(key);
        return ttl;
    }

}
